// pages/01/11.js
Page({

     /**
      * 页面的初始数据
      */
     data: {  
          statusBarHeight: getApp().globalData.statusBarHeight,
          //live: true,
          state: 1,
          chooseDest: false

     },
     chooseDest: function () {

          var that = this;
          that.setData({
               chooseDest: true
          })
          wx.chooseLocation({
               success: function (res) {
                    console.log("name:" + res.name);
                    that.setData({
                         selectedAddress: res.address,
                         longitude: res.longitude,
                         latitude: res.latitude,
                    });
                    if (that.data.state == 1) {
                         console.log('this.data.state == 1');
                         var rent_status_one = wx.getStorageSync('rent_status_one');
                         rent_status_one.address = res.address;
                         wx.setStorageSync('rent_status_one', rent_status_one);
                         console.log("wx.getStorageSync('rent_status_one')");
                         console.log(wx.getStorageSync('rent_status_one'));
                    } else if (that.data.state == 2) {
                         console.log('this.data.state == 2');
                         var rent_status_two = wx.getStorageSync('rent_status_two')
                         rent_status_two.address = res.address;
                         wx.setStorageSync('rent_status_two', rent_status_two);
                         console.log("wx.getStorageSync('rent_status_two')");
                         console.log(wx.getStorageSync('rent_status_two'));

                    } else if (that.data.state == 3) {
                         console.log('this.data.state == 3');
                         var rent_status_three = wx.getStorageSync('rent_status_three');
                         rent_status_three.address = res.address;
                         wx.setStorageSync('rent_status_three', rent_status_three);
                         console.log("wx.getStorageSync('rent_status_three')");
                         console.log(wx.getStorageSync('rent_status_three'));
                    }
               }
          })
     },
     /**
      * 生命周期函数--监听页面加载
      */
     onLoad: function (options) {

     },

     /**
      * 生命周期函数--监听页面初次渲染完成
      */
     onReady: function () {

     },

     /**
      * 生命周期函数--监听页面显示
      */
     onShow: function () {

     },

     /**
      * 生命周期函数--监听页面隐藏
      */
     onHide: function () {

     },

     /**
      * 生命周期函数--监听页面卸载
      */
     onUnload: function () {

     },

     /**
      * 页面相关事件处理函数--监听用户下拉动作
      */
     onPullDownRefresh: function () {

     },

     /**
      * 页面上拉触底事件的处理函数
      */
     onReachBottom: function () {

     },

     /**
      * 用户点击右上角分享
      */
     onShareAppMessage: function () {

     }
})